<?php

namespace App\Models;

class AfterSaleOrderAudit extends Base
{
    /**
     * 处理状态; 1:待审核
     */
    const STATUS_PENDING = 1;

    /**
     * 处理状态; 2:跟进中
     */
    const STATUS_FOLLOWING_UP = 2;

    /**
     * 处理状态; 3:已通过
     */
    const STATUS_PASSED = 3;

    /**
     * 处理状态; 4:未通过
     */
    const STATUS_DID_NOT_PASS = 4;

    /**
     * 处理状态; 5:已取消
     */
    const STATUS_CANCELLED = 5;

    /**
     * 处理状态
     */
    const STATUS_MAP = [
        self::STATUS_PENDING => '待审核',
        self::STATUS_FOLLOWING_UP => '跟进中',
        self::STATUS_PASSED => '已通过',
        self::STATUS_DID_NOT_PASS => '未通过',
        self::STATUS_CANCELLED => '已取消',
    ];

    public function afterSaleOrder()
    {
        return $this->belongsTo(AfterSaleOrder::class);
    }

    public function administrator()
    {
        return $this->belongsTo(Administrator::class, 'operator_id');
    }
}
